<?php /* SVN: $Id: $ */ ?>
<div class="container_24 payments order add-wallet js-responses js-main-order-block js-submit-target-block space-top">
	
	<?php echo $this->Form->create('User', array('action' => 'add_to_wallet', 'id' => 'PaymentOrderForm', 'class' => 'js-submit-target normal')); ?>
<div class="shodow-tl">
   <div class="shodow-tr">
    <div class="shodow-tm"> </div>
  </div>
</div>
<div class="shodow clearfix">
<?php if (empty($this->request->params['prefix'])): ?>
		<h2 class="project-title">
		<?php echo __l('Add Amount to Wallet'); ?></h2>
		<?php echo $this->element('user-avatar', array('config' => 'sec')); ?>
		<?php else: ?>
<h2 class="project-title"><?php echo __l("Add Amount to Wallet");?></h2>
<?php endif; ?>
</div>
						<div class="shad-bg-lft clearfix">
							<div class="shad-bg-rgt">
								<div class="shad-bg">
		<div class="padd-center main-section">
		<div class="current-balance content-info">
		<span><?php echo __l('Your current available balance:').' '. Configure::read('site.currency').$user_info['User']['available_wallet_amount'];?></span>
		</div>
			<?php
				echo $this->Form->input('user_id', array('type' => 'hidden', 'value' => $this->Auth->user('id')));
				if (!Configure::read('wallet.max_wallet_amount')):
    				$max_amount = 'No limit';
				else:
	    			$max_amount = Configure::read('site.currency').Configure::read('wallet.max_wallet_amount');
				endif;
				$info = sprintf(__l('Minimum amount: %s, Maximum Amount: %s'), Configure::read('site.currency').Configure::read('wallet.min_wallet_amount'), $max_amount);
				echo $this->Form->input('amount', array('label' => __l('Amount') . ' (' . Configure::read('site.currency') . ')', 'info' => $info));
				echo $this->Form->input('type', array('type' => 'hidden'));

			?>
			<fieldset class="fields-block round-5">
			<h3><?php echo __l('Payment Type'); ?></h3>
			<?php echo $this->Form->input('payment_gateway_id', array('legend' => false, 'type' => 'radio', 'options' => $gateway_options['paymentGateways'], 'class' => 'js-payment-type')); ?>
			</fieldset>
			<div class="clearfix states-block payment-states-block">
			
				<div class="clearfix js-paypal-main <?php echo (!empty($this->request->data['User']['payment_gateway_id']) && $this->request->data['User']['payment_gateway_id'] == ConstPaymentGateways::PayPal) ? "" : ''?> ">
				<?php
                     if (!empty($gateway_options['paymentGateways'][ConstPaymentGateways::PayPal])): ?>
					<!-- USING NORMAL -->
					<fieldset class="fields-block round-5">
					<h3><?php echo __l('Pay With PayPal'); ?></h3>
					<div class="js-normal-paypal user-stats pay-paypal buying-bg">
						<div class="page-information clearfix"><?php echo __l('This will take you to the paypal.com'); ?></div>
						<div class="clearfix">
							<?php echo $this->Form->submit(__l('Pay with PayPal'), array('name' => 'data[User][adaptive_normal]', 'id'=>'pay_button','class' => 'paypal-block'));?>
						</div>
					</div>
					</fieldset>
               	<?php endif; ?>
				</div>
			
			</div>
		</div>
</div>
</div>
						</div>
						<div class="l-curve-bot">
							<div class="r-curve-bot">
								<div class="bot-bg"></div>
							</div>
						</div>

	<?php echo $this->Form->end();?>
</div>
<?php 
	if (Configure::read('paypal.is_embedded_payment_enabled')):
		echo $this->element('js-embedded-paypal', array('config' => 'sec'));
	endif;
?>